          <!DOCTYPE html>
          <html lang="zh-cn">
          <head>
              <meta charset="utf-8">
              <meta http-equiv="X-UA-Compatible" content="IE=edge">
              <meta name="viewport" content="width=device-width, initial-scale=1">
              <meta name="description" content="">
              <meta name="author" content="">
              <link rel="icon" href="../../favicon.ico">

              <title>Off Canvas Template for Bootstrap</title>

              <!-- Bootstrap core CSS -->
              <link href="assets/css/bootstrap.min.css" rel="stylesheet">

              <!-- Custom styles for this template -->
              <link href="assets/css/offcanvas.css" rel="stylesheet">
              <link href="assets/css/style.css" rel="stylesheet">
              <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
              <!--[if lt IE 9]>
              <script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
              <script src="assets/js/ie-emulation-modes-warning.js"></script>

              <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
              <!--[if lt IE 9]>
              <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
              <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
              <![endif]-->
          </head>

          <body>
          <nav class="navbar navbar-fixed-top navbar-inverse">
            <div class="container-fluid">
              <!-- Brand and toggle get grouped for better mobile display -->
              <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                  <span class="sr-only">Toggle navigation</span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </button>
               
              </div>
              <?php 
                require_once('tpl/inc_admin.php'); 
              //require_once('system/dbConn.php');
              connect();
              $sql='select* from videotype ';
              $rs=mysql_query($sql)or die('查询1失败！'.mysql_error());
           ?>
           <ul class="nav navbar-nav">
            <li><a href="index.php">首页</a></li>
            <?php 
                  while($row=mysql_fetch_assoc($rs))
                  {
             ?>
               <li>
                   <a href="list.php?tid=<?php
                   echo $row["tid"];?>
                   "><?php 
                   echo $row["typename"];
                    ?>
                   </a></li>
                   <?php } ?>
           </ul>

            
              
                <form class="navbar-form navbar-left" role="search" action="search.php">
                  <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search" name="videoname">
                  </div>
                  <button type="submit" class="btn btn-default">搜索</button>
                </form>
                <ul class="nav navbar-nav navbar-right">
                <li class="active"> <a href="">欢迎 <?php 
                session_start();
                if (isset($_SESSION["user"]))
                  echo "  ".$_SESSION["user"]."";
              else{
                  echo"您";
              }
                 ?> 访问本网站</a></li>
                 <?php 
                 if(isset($_SESSION["user"]))
                 {
                   ?>
                   <li><a href="logout.php">注销</a></li>
                     <li class="dropdown">
                         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                         aria-haspopup="true" aria-expanded="false">个人中心<span class="caret"></span></a>
                         <ul class="dropdown-menu">
                          <li><a href="#" data-toggle="modal" data-target="#changePassword">修改个人密码</a></li>
                          <li><a href="#" data-toggle="modal" data-target="#changeInfor">修改个人信息</a></li>   
                         <li><a href="myCommentList.php">我的评价</a></li>
                         </ul>
                     </li> 
                     <?php 
                     }else{ 
                      ?>   
                  <li><a href="#" data-toggle="modal" data-target="#login">登录</a></li>
                  <li><a href="#" data-toggle="modal" data-target="#reg">注册</a></li>
               <?php 
               } 
               ?>
      






           </ul>
           </div>
           </div>
           </nav>
  <div class="container">



  <?php
  require_once('tpl/head.php');
  include_once('./system/dbConn.php');
  //连接数据库
  connect();
  //查询首页电影专栏的六个视频
  $sql1="select * from videotype where typename='电影'";
  $result1 = mysql_query($sql1) or die('查询失败！'.mysql_error());
  $row1=mysql_fetch_assoc($result1);
  $tid1=$row1["tid"];
  //根据查的的视频 id 查询电影栏目的六条记录
  $sql11="select * from videos where tid='$tid1' limit 6";
  $result11 = mysql_query($sql11) or die('查询失败！'.mysql_error());
  //查询首页电视剧专栏的六个视频
  $sql2="select * from videotype where typename='电视剧'";
  $result2 = mysql_query($sql2) or die('查询失败！'.mysql_error());
  $row2=mysql_fetch_assoc($result2);
  $tid2=$row2["tid"];
  //根据查的的视频 id 查询电视剧栏目的六条记录
  $sql22="select * from videos where tid='$tid2' limit 6";
  $result22 = mysql_query($sql22) or die('查询失败！'.mysql_error());
  //查询首页动画片专栏的六个视频
  $sql3="select * from videotype where typename='动漫'";
  $result3 = mysql_query($sql3) or die('查询失败！'.mysql_error());
  $row3=mysql_fetch_assoc($result3);
  $tid3=$row3["tid"];
  //根据查的的视频 id 查询动画片栏目的六条记录
  $sql33="select * from videos where tid='$tid3' limit 6";
  $result33 = mysql_query($sql33) or die('查询失败！'.mysql_error());
  //查询首页原创专栏的六个视频
  $sql4="select * from videotype where typename='二次元'";
  $result4 = mysql_query($sql4) or die('查询失败！'.mysql_error());
  $row4=mysql_fetch_assoc($result4);
  $tid4=$row4["tid"];
  $sql44="select * from videos where tid='$tid4' limit 6";
  $result44 = mysql_query($sql44) or die('查询失败！'.mysql_error());
  //查询首页动画片专栏的六个视频
  $sql5="select * from videotype where typename='搞笑'";
  $result5 = mysql_query($sql5) or die('查询失败！'.mysql_error());
  $row5=mysql_fetch_assoc($result5);
  $tid5=$row5["tid"];
  $sql55="select * from videos where tid='$tid5' limit 6";
  $result55 = mysql_query($sql55) or die('查询失败！'.mysql_error());
  //查询首页动画片专栏的六个视频
  $sql6="select * from videotype where typename='综艺'";
  $result6 = mysql_query($sql6) or die('查询失败！'.mysql_error());
  $row6=mysql_fetch_assoc($result6);
  $tid6=$row6["tid"];
  $sql66="select * from videos where tid='$tid6' limit 6";
  $result66 = mysql_query($sql66) or die('查询失败！'.mysql_error());
  //查询首页动画片专栏的六个视频
  $sql7="select * from videotype where typename='真人秀'";
  $result7 = mysql_query($sql7) or die('查询失败！'.mysql_error());
  $row7=mysql_fetch_assoc($result7);
  $tid7=$row7["tid"];
  //根据查的的视频 id 查询原创栏目的六条记录
  $sql77="select * from videos where tid='$tid7' limit 6";
  $result77 = mysql_query($sql77) or die('查询失败！'.mysql_error());
  //查询首页显示的点击排行 4 个视频和下载排行的 4 个视频
  $sql8="select * from videos order by hittimes desc limit 4";
  $sql9="select * from videos order by downtimes desc limit 4";
  $result8 = mysql_query($sql8) or die('查询失败！'.mysql_error());
  $result9 = mysql_query($sql9) or die('查询失败！'.mysql_error());
  ?>




















  <!--幻灯片开始-->

  <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
      <!-- Indicators -->
      <ol class="carousel-indicators">
          <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
          <li data-target="#carousel-example-generic" data-slide-to="1"></li>
          <li data-target="#carousel-example-generic" data-slide-to="2"></li>
      </ol>

      <!-- Wrapper for slides -->
      <div class="carousel-inner">
          <div class="item active">
              <img src="assets/images/img4.jpg" class="img-responsive" alt="Apple iPhone 5S">

              <div class="carousel-caption">
                  <h3>Apple iPhone 5S</h3>

              </div>
          </div>
          <div class="item">
              <img src="assets/images/img2.jpg" class="img-responsive" alt="Samsung Galaxy Note 3">

              <div class="carousel-caption">
                  <h3>Samsung Galaxy Note 3</h3>

              </div>
          </div>
          <div class="item">
              <img src="assets/images/img3.jpg" class="img-responsive" alt="Apple iPhone 5S">

              <div class="carousel-caption">
                  <h3>Sony Xperia Z1</h3>

              </div>
          </div>
      </div>

      <!-- Controls -->
      <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
          <span class="glyphicon glyphicon-chevron-left"></span>
      </a>
      <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
          <span class="glyphicon glyphicon-chevron-right"></span>
      </a>
  </div>
  <!--幻灯片结束-->



      <div class="row row-offcanvas row-offcanvas-right">

          <div class="col-xs-12 col-sm-9">


              <div class="row text-center">
                  <div class="col-xs-12 col-lg-12 mlist">
          <h2>电影</h2>
        <ul class="list-inline row text-center">
     <?php
    while($row1=mysql_fetch_assoc($result11))
       {
  
      ?>
       <li class="col-xs-4 col-sm-3 col-lg-2">
       <img src="./images/<?php echo $row1["pic"];?>" class="responsive img-thumbnail"/>
       <p><a href="show.php?vid=<?php echo $row1["vid"];?>"><?php echo $row1["videoname"];?></a>
  </p>
  </li>
  <?php
  }
  ?>
  </ul>
  <p><a class="btn btn-default" href="list.php?tid=<?php echo $tid1;?>" role="button">更多 &raquo;</a></p>
  </div>
  <!--/.col-xs-6.col-lg-4-->

              </div>
              <!--/row-->
              <div class="row text-center">
                  <div class="col-xs-12 col-lg-12 mlist">
          <h2>电视剧</h2>
        <ul class="list-inline row text-center">
     <?php
    while($row2=mysql_fetch_assoc($result22))
       {
  
      ?>
       <li class="col-xs-4 col-sm-3 col-lg-2">
       <img src="./images/<?php echo $row2["pic"];?>" class="responsive img-thumbnail"/>
       <p><a href="show.php?vid=<?php echo $row2["vid"];?>"><?php echo $row2["videoname"];?></a>
  </p>
  </li>
  <?php
  }
  ?>
  </ul>
  <p><a class="btn btn-default" href="list.php?tid=<?php echo $tid2;?>" role="button">更多 &raquo;</a></p>
  </div>
  <!--/.col-xs-6.col-lg-4-->

              </div>
              <!--/row-->
          </div>
          <!--/.col-xs-12.col-sm-9-->
       

          <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
              <div class="list-group text-center">
                  <h2 style="color:white;" >点击排行</h2>
      <ul class="list-inline row text-center">
      <?php
      while($row8=mysql_fetch_assoc($result8))
    {
    ?>
     <li class="col-xs-12 col-lg-6">
      <img src="./images/<?php echo $row8["pic"];?>" class="responsive img-thumbnail" />
   <p><a href="show.php?vid=<?php echo $row8["vid"];?>"><?php echo mb_substr($row8["videoname"],0,6,'utf-8');?></a>
  </p>
   </li>
 <?php
  }
  ?>
</ul>
</div>
           <div class="list-group text-center">
                  <h2 style="color:white;" >下载排行</h2>
      <ul class="list-inline row text-center">
      <?php
      while($row9=mysql_fetch_assoc($result9))
    {
    ?>
     <li class="col-xs-12 col-lg-6">
      <img src="./images/<?php echo $row9["pic"];?>" class="responsive img-thumbnail" />
   <p><a href="show.php?vid=<?php echo $row9["vid"];?>"><?php echo mb_substr($row9["videoname"],0,6,'utf-8');?></a>
  </p>
   </li>
 <?php
  }
  ?>
</ul>
  </div>
              </div>
          <!--/.sidebar-offcanvas-->
      </div>
      <!--/row-->

     

  </div>
  <!--/.container-->
   <hr>

      <footer>
          <p>&copy; Company 2014</p>
      </footer>

  <!-- Bootstrap core JavaScript
  ================================================== -->
  <!-- Placed at the end of the document so the pages load faster -->
  <script src="assets/js/jquery.min.js"></script>
  <script src="assets/js/bootstrap.min.js"></script>

  <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  <script src="assets/js/ie10-viewport-bug-workaround.js"></script>

  <script src="offcanvas.js"></script>
  <script>
      $('.carousel').carousel({
          interval: 3000 //changes the speed
      })
  </script>
  </body>
  </html>
